package edu.sctu.practice.class01.fengleilin.test03;

/**
 * Created by fll on 2015/10/13.
 */
public class MyTime {
    private int hour;
    private int minute;
    private int second;

    public void display() {
        System.out.println("当前的时间是：" + hour + ":" + minute + ":" + second);
    }

    public void addSecond(int sec) {
        second = second + sec;
    }

    public void addMinute(int min) {
        minute = minute + min;
    }

    public void addHour(int hou) {
        hour = hour + hou;
    }

    public void subSecond(int sec) {
        second = second - sec;
    }

    public void subMinute(int min) {
        minute = minute - min;
    }

    public void subHour(int hou) {
        hour = hour - hou;
    }

    public void check() {
        if (hour <= 24 & hour >= 0 & minute <= 60 & minute >= 0 & second <= 60 & second >= 0) {
            System.out.println("这是符合规定的时间");
        } else {
            System.out.println("这是不符合规定的时间");
        }
    }


}